Repository navigation
feat(sim): add native cross-harness Self-Improvement Memory - #64
Merged
Merged
Conversation
Previously, harness self-improvement memory (SIM) only ran through Claude Code hooks and CLI scripts, leaving Codex, Antigravity (ACP), OpenCode, and other T3 Code providers without shared rule injection, read-before-write enforcement, anti-self-grading, live runtime telemetry, or cross-provider auditing. This adds native, file-backed cross-harness SIM integration to T3 Code with zero SQLite migrations and full format-v2 / schema-3 byte-for-byte parity with standalone sim.mjs: - SimStore, SimService, and SimAuditService in apps/server/src/sim/ sharing ~/.claude/sim/ (envelope-only harness field, read-only loads without lock/rewrite, symlink and mode preservation, CLI fork self-grade auditing, and configurable on-demand advisor escalation via ServerSettings.sim.advisorModelSelection). - Native MCP toolkit (sim_read, sim_write, sim_apply_harness_change) deriving caller identity server-side, enforcing per-epoch read-before-write and fork-family anti-self-grading, and gating live harness edits on full-access/default mode and workspace/harnessDir confinement. - Filtered, epoch-cached thread instruction injection (<4KB Codex-safe sections) for Codex, ACP, and OpenCode, plus ACP threadInstructions passthrough. - SimObserverReactor tracking restart-safe context epochs in t3-epochs.json and logging cross-provider harness/runtime signals to telemetry.jsonl. Co-Authored-By: Antigravity (gemini-4-neon) with Claude Opus 5.5 and Claude Fable 5.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Harness self-improvement memory (SIM) previously only worked inside Claude Code via local hooks and CLI scripts, leaving Codex, Antigravity (ACP), OpenCode, and other T3 Code providers without shared rule injection, read-before-write gates, anti-self-grading, live runtime signals, or unified auditing.
This adds native, file-backed cross-harness SIM integration to the fork with zero SQLite migrations, keeping
agentContextBudget.jsonbyte-identical to upstream and staying 100% format-v2 / schema-3 compatible with standalonesim.mjs:apps/server/src/sim/):SimStore,SimService, andSimAuditServiceshare~/.claude/sim/(sim.jsonl,sim.json,seen/,t3-epochs.json,telemetry.jsonl).harnessis stamped only on thesim.jsonlevent envelope whilesim.jsonstays schema 3 byte-for-byte identical tosim.mjs(no ping-pong rewrites). Read paths and dry runs useloadReadOnlywithout locking or healingsim.json.SimAuditServicescans T3 SQLite read-only across all providers/models, telemetry, external Claude logs, and flags CLI fork self-grades (FORK SELF-GRADE).apps/server/src/mcp/toolkits/sim/): Exposessim_read,sim_write, andsim_apply_harness_changeto all providers. Caller identity (t3:thread,cc:native Claude session, fork family,driver,model,worktreePath ?? project.workspaceRoot) is derived strictly server-side fromMcpInvocationContext+ projections. Enforces per-epochindex/by_file+ entry read-before-write, fork/side-chat anti-self-grading, symlink + file-mode preservation on edit/rollback, andfull-access/defaultmode +harnessDir/workspace confinement for live applies (dryRun: trueworks in all modes).threadInstructionsdelivery to ACP.ServerSettings.sim):SimObserverReactorpersists active provider threads int3-epochs.json(resetting seen epochs on compaction, handoff, or/clear/provider switch even across restarts) and records harness/runtime signals totelemetry.jsonl.ServerSettings.sim.advisorModelSelection(defaultclaudeAgent/claude-fable-5-2, configurable ornull) surfaces on-demanddelegate_task(role: "design") hints only duringreview/auditfor genuinely tricky cases.Verification
RunExecutionService.test.ts+ClaudeAdapterV2.test.tspass.apps/server,apps/desktop, andapps/web(plus all 42 workspace packages viacheck:changed) pass with 0 errors.vp fmt,vp lint, andvp run knip:checkpass with 0 errors.sim.jsonparity against unmodifiedsim.mjson a temporary sandbox copy.Built with Antigravity (
gemini-4-neon), with Claude Opus 5.5 implementation/review delegates and Claude Fable 5.2 architecture advisor.